		function manageInfo(OuId,limit,offset,name){
			console.log(OuId,limit,offset,name)
			$.ajax({
//				url:"http://localhost/front/trol/ctrlUserList",
				url: Server + "/front/trol/ctrlUserList",
				data:{
					"OuId": OuId,
					"limit": limit,
					"offset": offset,
					"name": name
					},
				type:"POST",
				dataType:"json",
				success : function(data) {
					var newdata = data.rows;
					var html = "";
					var top = "<tr style='height: 70px;'>\
							<th>序号</th>\
							<th>用户名</th>\
							<th>所属单位</th>\
							<th>真实姓名</th>\
							<th>职位</th>\
							<th>联系电话</th>\
							<th>身份证号</th>\
							<th>申请时间</th>\
							<th>申请结果</th>\
							<th>操作</th>\
						</tr>";
					var pattern = '<tr>\
							<td>#0</td>\
							<td>#1</td>\
							<td>#2</td>\
							<td>#3</td>\
							<td>#4</td>\
							<td>#5</td>\
							<td>#6</td>\
							<td>#7</td>\
							<td>#8</td>\
							<td><a class="td_a" onclick="details(#9)">查看详情</a></td>\
						</tr>';
					for(var i = 0 ; i < data.rows.length ; i++){
						if(newdata[i].checkResult == 0 ){
							newdata[i].checkResult = "审核成功";
						}else if(newdata[i].checkResult == 1){
							newdata[i].checkResult = "待审核";
						}else if(newdata[i].checkResult == 2){
							newdata[i].checkResult = "审核失败";
						}
						var item = "";
						item += pattern
							.replace("#0", newdata[i].rownum)
							.replace("#1", newdata[i].username)
							.replace("#2", newdata[i].unitName)
							.replace("#3", newdata[i].realname)
							.replace("#4", newdata[i].post)
							.replace("#5", newdata[i].phone)
							.replace("#6", newdata[i].idCard)
							.replace("#7", new Date(newdata[i].createTime).Format("yyyy-MM-dd"))
							.replace("#8", newdata[i].checkResult)
							.replace("#9", newdata[i].id);
						html += item;
					}
					html = top + html;
					$("#tablelist").html(html);
				}
			});
		}
	
		
		function details(id){
			$(location).attr('href', 'ins29?id='+id+'');
		}
		function issue_list(){
			$(location).attr('href', 'sun_jigou30');
		}
		
		function managepage(OuId,limit,offset,name){
			$.ajax({
//				url:"http://localhost/front/trol/ctrlUserList",
				url:Server + "/front/trol/ctrlUserList",
				data:{
					"name":name,
					"OuId": OuId,
					"limit": limit,
					"offset": offset
					},
				type : "POST",
				dataType: "JSON",
				success : function(data) {
					$("#pagination3").pagination({
						currentPage: 1,
						totalPage: Math.ceil(Number(data.total/limit)),
						isShow: true,
						count: 7,
						homePageText: "首页",
						endPageText: "尾页",
						prevPageText: "<上一页",
						nextPageText: "下一页>",
						callback: function(current) {
							managepage(OuId,limit,$("#pagination3").pagination("getPage").current-1,name)
							manageInfo(OuId,limit,$("#pagination3").pagination("getPage").current-1,name);
						}
					});
				}
			});
		}
		function manageload(){
			if($("#searchInput").val()!=null)
				var name = $("#searchInput").val();
			else 
				var name = '';
//			id注意
			var OuId = organizationId;
//			var OuId = 2;
			var limit = 10;
			var offset = 0;
			managepage(OuId,limit,offset,name);
			manageInfo(OuId,limit,offset,name);
		}

		
		Date.prototype.Format = 
			function(fmt){
			var o = {
				"M+": this.getMonth() + 1, //月份 
       			"d+": this.getDate(), //日 
        		"h+": this.getHours(), //小时 
        		"m+": this.getMinutes(), //分 
        		"s+": this.getSeconds(), //秒 
        		"q+": Math.floor((this.getMonth() + 3) / 3), //季度 
        		"S": this.getMilliseconds() //毫秒 
			};
			if(/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
			for(var k in o)
			if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    		return fmt;
		}	
		
		$(function(){
			manageload();
		});